<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

</html>
<script>
    var arr = [5, 2, 4, 3, 4, 1, 5]
    var k = 2
    var m = 4
    var newArr = Array.from(new Set(arr))
    // console.log(newArr);
    newArr.sort((a, b) => {
        return a - b
    })
    console.log(newArr);
    for (let i = 0; i < newArr.length; i++) {
        var sum = 0 
        var k1 = 0
        var m1 = 0
        k1 = newArr[k-1]
        m1 = newArr[m-1]
        sum = k1+m1
    }console.log(sum);
</script>